//
//  RecSubjectTableViewCell.m
//  TravelEveryDay
//
//  Created by dlios on 15-10-22.
//  Copyright (c) 2015年 com.lanou3g. All rights reserved.
//

#import "RecSubjectTableViewCell.h"

@implementation RecSubjectTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _image = [[UIImageView alloc] initWithFrame:CGRectMake(10 * WIDTH, 0, SCREEN_WIDTH - 25, 200 * HEIGHT)];
        _image.alpha = 0.6;
        _image.layer.cornerRadius = 5;
        _image.layer.masksToBounds = YES;
        [self.contentView addSubview:_image];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, 40, SCREEN_WIDTH - 60, 40)];
        _titleLabel.font = [UIFont boldSystemFontOfSize:22];
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_titleLabel];
        
        _subLabel = [[UILabel alloc]initWithFrame:CGRectMake(30, 90, SCREEN_WIDTH - 60, 30)];
        _subLabel.textColor = [UIColor whiteColor];
        _subLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_subLabel];

    }
    return self;
}
-(void)getData:(RecSubjectModel *)model
{
    [_image sd_setImageWithURL:[NSURL URLWithString:model.cover] placeholderImage:PLACEHOLDERIMAGE];
    _titleLabel.text = model.cover_title;
    _subLabel.text = [NSString stringWithFormat:@"「 %@ 」",model.cover_sub_title];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
